{include common/header}
<script src="__PUBLIC__/js/jquery.overlay.min.js"></script> 
<script>
$(function(){
	var w=$(window).width();
	var h=$(window).height();
	w=(w-500)/2;
	h=(h-50)/2;
	var left =w+'px';
	var top = h+'px';
	
	var $modal = $('<div><img src="__PUBLIC__/img/loading.gif">文件导入中~~~</div>')
        .attr('id', 'modal')
        .css({
          background: '#fff',
        zIndex: 3000,
        padding: '10px',
        width: '500px',
        height: '50px',
        margin: '0 auto',
        opacity: 1,
        position: 'absolute',
        top: top,
        left: left
      });
      
    $('#modal-trigger').click(function(evt) {
        evt.preventDefault();
        $(this).overlay({
        effect: 'fade',
        opacity: 0.8,
        closeOnClick: false,
        onShow: function() {
        	$('.form-horizontal').submit();
            $('body').append($modal);
            },
        onHide: function() {
            $modal.remove();
            },
        })
    });

});
</script>
{include common/left}
<div id="content">
  <ul class="breadcrumb">
    <li><a href="__ROOT__"><i class="icon-home"></i>首页</a> <span class="divider">/</span></li>
    <li class="active">房源管理 <span class="divider">/</span></li>
    <li class="active">导入{if $type==1}出租{else}出售{/if}房源</li>
   </ul>
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-box">
          <div class="widget-title"> 
            <h5><span class="icon"> <i class="icon-align-justify"></i> </span>导入{if $type==1}出租{else}出售{/if}房源</h5>
          </div>
          <div class="widget-content nopadding">
         <div class="alert">今日导入 {$today_count} 条 ， 共上传 {$all_count} 条</div>

             <form action="{url('userestate/import')}" method="post" enctype="multipart/form-data" class="form-horizontal">            
		      <div class="control-group">
		          <label class="control-label">数据类型</label>
		          <div class="controls">
		            <select name="type" class="span3">                                    
                  <option value="1" {if $_GET['type']==1}selected{/if}>出租</option>                  
                  <option value="2" {if $_GET['type']==2}selected{/if}>出售</option>
                  </select> 
		            
		          </div>
		        </div>  
             <div class="control-group">
		          <label class="control-label">选择文件</label>
		          <div class="controls">
		            <input name="excel" type="file" id="excel" />
		          </div>
		        </div>       
	            <div class="form-actions">
	            <!--<input type="hidden" name="type" value="{$type}" />-->
	              <input type="submit" id="modal-trigger" class="btn btn-primary" value="确认">
	            </div>
            </form>
          </div>
        </div>
        
      </div>
    </div>
  </div>
</div>
{include common/footer}